<script setup>
import {ref} from "vue";

const isShow = ref(false)
</script>

<template>
<h1>隐藏显示指令</h1>
  <p v-if="true">jack</p>
  <p v-if="false">rose</p><hr>
  <p v-show="true">1</p>
  <p v-show="false">2</p>
  <hr>
  <p v-if="isShow">sun</p>
  <p v-else>moon</p>
</template>

<style scoped>

</style>